/**
 * <p>功能:图片浏览器功能 <p>
 * @extends Ext.panel.Panel
 * @override
 * @author wys 15909910367@163.com on 2018/3/27.
 * @version {$}
 */
Ext.define('Jason.view.example.form.imgBrowse.MainView',{
    extend : 'Ext.panel.Panel',
    xtype : 'imgBrowse',
    requires : ['Wys.view.ImgView','Wys.view.AttachmentWin'],
    items : [{
        xtype : 'ImgView',
        store : Ext.create('Ext.data.Store',{
            data : [
                {thumbnailsPath : 'resources/images/imgBrowse/img/thumbnails/tibet-1.jpg' , text : '示例图片',sourcePath:'resources/images/imgBrowse/img/tibet-1.jpg'},
                {thumbnailsPath : 'resources/images/imgBrowse/img/thumbnails/tibet-2.jpg' , text : '示例图片1',sourcePath:'resources/images/imgBrowse/img/tibet-2.jpg'},
                {thumbnailsPath : 'resources/images/imgBrowse/img/thumbnails/tibet-3.jpg' , text : '示例图片2',sourcePath:'resources/images/imgBrowse/img/tibet-3.jpg'},
                {thumbnailsPath : 'resources/images/imgBrowse/img/thumbnails/tibet-4.jpg' , text : '示例图片3',sourcePath:'resources/images/imgBrowse/img/tibet-4.jpg'},
                {thumbnailsPath : 'resources/images/imgBrowse/img/thumbnails/tibet-5.jpg' , text : '示例图片4',sourcePath:'resources/images/imgBrowse/img/tibet-5.jpg'},
                {thumbnailsPath : 'resources/images/imgBrowse/img/thumbnails/tibet-6.jpg' , text : '示例图片5',sourcePath:'resources/images/imgBrowse/img/tibet-6.jpg'}
            ]
        })
    },{
        xtype : 'codeField',
        readOnly : true,
        width : '97%',
        margin : '0px 7px',
        value : "调用方法：使用方法： \r\n 1、在需要使用的组件定义或者页面类中使用 requires:[\"Wys.view.ImgView\"] 或 Ext.requires(\"Wys.view.ImgView\") 将自定义组件引入 \r\n 2、将组件加入到要显示的容其中.如(items:[xtype:'ImgView',store:....略]),即可完成调用"
    },{
    	xtype : 'button',
    	text : '浏览附件',
    	handler : function(){
    		Ext.create('Wys.view.AttachmentWin',{
    			imgArray:[
                    {thumbnailsPath : 'resources/images/imgBrowse/img/thumbnails/tibet-1.jpg' , text : '示例图片',sourcePath:'resources/images/imgBrowse/img/tibet-1.jpg'},
                    {thumbnailsPath : 'resources/images/imgBrowse/img/thumbnails/tibet-2.jpg' , text : '示例图片1',sourcePath:'resources/images/imgBrowse/img/tibet-2.jpg'},
                    {thumbnailsPath : 'resources/images/imgBrowse/img/thumbnails/tibet-3.jpg' , text : '示例图片2',sourcePath:'resources/images/imgBrowse/img/tibet-3.jpg'},
                    {thumbnailsPath : 'resources/images/imgBrowse/img/thumbnails/tibet-4.jpg' , text : '示例图片3',sourcePath:'resources/images/imgBrowse/img/tibet-4.jpg'},
                    {thumbnailsPath : 'resources/images/imgBrowse/img/thumbnails/tibet-5.jpg' , text : '示例图片4',sourcePath:'resources/images/imgBrowse/img/tibet-5.jpg'},
                    {thumbnailsPath : 'resources/images/imgBrowse/img/thumbnails/tibet-6.jpg' , text : '示例图片5',sourcePath:'resources/images/imgBrowse/img/tibet-6.jpg'}
                ]
    		}).show();
    	}
    },{
    	xtype : 'button',
    	margin : '0 8',
    	text : '批量加载附件列表',
    	handler : function(btn){
    		Ext.create('Wys.view.AttachmentWin',{
    			type : 2,
    			imgArray:[
                    {thumbnailsPath : 'resources/images/imgBrowse/img/thumbnails/tibet-1.jpg' , title : '示例图片', filename:'tibet-1.jpg',id:1,isRemove:false},
                    {thumbnailsPath : 'resources/images/imgBrowse/img/thumbnails/tibet-2.jpg' , title : '示例图片1',filename:'tibet-2.jpg',id:2,isRemove:false},
                    {thumbnailsPath : 'resources/images/imgBrowse/img/thumbnails/tibet-3.jpg' , title : '示例图片2',filename:'tibet-3.jpg',id:3,isRemove:false},
                    {thumbnailsPath : 'resources/images/imgBrowse/img/thumbnails/tibet-4.jpg' , title : '示例图片3',filename:'tibet-4.jpg',id:4,isRemove:false},
                    {thumbnailsPath : 'resources/images/imgBrowse/img/thumbnails/tibet-5.jpg' , title : '示例图片4',filename:'tibet-5.jpg',id:5,isRemove:false},
                    {thumbnailsPath : 'resources/images/imgBrowse/img/thumbnails/tibet-6.jpg' , title : '示例图片5',filename:'tibet-6.jpg',id:6,isRemove:false}
                ]
    		}).show();
    	}
    }]
})